<!--
* @description 人物属性计算
* @fileName sala.vue
* @author huangyu
* @date 2022/05/31 14:36:50
!-->
<template>
    <div class="aionCalc">
        <!-- <div>{{ occAttr }}</div> -->
        <!-- <div>{{ calcCount }}</div> -->
        <!-- {{zbModelPre}} -->
        <!-- <br> -->
        <!-- tzRow:{{tzRow}} -->
        <div class="CalcMain">
            <el-row>
                <el-col :span="12">
                    <!-- 左手武器 -->
                    <div class="wuqiZ CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('wuqiZ')">
                                <div v-if="wuqiZ.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + wuqiZ.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="wuqiZ.icon">
                                    <vDataDetail :model="wuqiZ" :strong="wuqiZ.strong" :msList="wuqiZ.msList" :strongModel="wuqiZ.strongModel"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ wuqiZ.strong ? '+' + wuqiZ.strong : '' }} {{ isSSWQ ? '双手' : '左手' }}：{{
                                wuqiZ.name
                        }}
                            {{ wuqiZ.level }}</div>
                        <div v-if="wuqiZ.icon">
                            <div class="del" @click="delDataModel('wuqiZ')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('wuqiZ')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                    <!-- 右手武器/合成武器 -->
                    <div :class="isSSWQ ? 'wuqiHC CalcBox' : 'wuqiY CalcBox'">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData(isSSWQ ? 'wuqiHC' : 'wuqiY')">
                                <div v-if="wuqiHC.icon && isSSWQ"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + wuqiHC.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div v-if="wuqiY.icon && !isSSWQ"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + wuqiY.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="wuqiHC.icon">
                                    <!-- 合成武器 只展示魔石信息 -->
                                    <vDataDetail :model="wuqiHC" :msList="wuqiHC.msList"></vDataDetail>
                                </div>
                                <div class="container" v-if="wuqiY.icon">
                                    <vDataDetail :model="wuqiY" :strong="wuqiY.strong" :msList="wuqiY.msList" :strongModel="wuqiY.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div v-if="isSSWQ">
                            <div class="des">合成：{{ wuqiHC.name }} {{ wuqiZ.level }}</div>
                            <div v-if="wuqiHC.icon">
                                <div class="del" @click="delDataModel('wuqiHC')" v-if="wuqiHC.icon"><i
                                        class="el-icon-error"></i></div>
                                <div class="add" @click="addMsStrong('wuqiHC')" v-if="wuqiHC.icon"><i
                                        class="el-icon-circle-plus"></i></div>
                            </div>
                        </div>
                        <div v-else>
                            <div class="des">{{ wuqiY.strong ? '+' + wuqiY.strong : '' }} 右手：{{ wuqiY.name }} {{
                                    wuqiZ.level
                            }}
                            </div>
                            <div v-if="wuqiY.icon">
                                <div class="del" @click="delDataModel('wuqiY')" v-if="wuqiY.icon"><i
                                        class="el-icon-error"></i></div>
                                <div class="add" @click="addMsStrong('wuqiY')" v-if="wuqiY.icon"><i
                                        class="el-icon-circle-plus"></i></div>
                            </div>
                        </div>
                    </div>
                    <!-- 防具-衣服 -->
                    <div class="fjYiFu CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('fjYiFu')">
                                <div v-if="fjYiFu.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + fjYiFu.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="fjYiFu.icon">
                                    <vDataDetail :model="fjYiFu" :strong="fjYiFu.strong" :msList="fjYiFu.msList" :strongModel="fjYiFu.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ fjYiFu.strong ? '+' + fjYiFu.strong : '' }} 衣服：{{ fjYiFu.name }} {{ fjYiFu.level }}
                        </div>
                        <div v-if="fjYiFu.icon">
                            <div class="del" @click="delDataModel('fjYiFu')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('fjYiFu')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                    <!-- 防具-下衣 -->
                    <div class="fjXiaYi CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('fjXiaYi')">
                                <div v-if="fjXiaYi.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + fjXiaYi.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="fjXiaYi.icon">
                                    <vDataDetail :model="fjXiaYi" :strong="fjXiaYi.strong" :msList="fjXiaYi.msList" :strongModel="fjXiaYi.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ fjXiaYi.strong ? '+' + fjXiaYi.strong : '' }} 下衣：{{ fjXiaYi.name }} {{ fjXiaYi.level
                        }}
                        </div>
                        <div v-if="fjXiaYi.icon">
                            <div class="del" @click="delDataModel('fjXiaYi')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('fjXiaYi')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                    <!-- 防具-护肩 -->
                    <div class="fjHuJian CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('fjHuJian')">
                                <div v-if="fjHuJian.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + fjHuJian.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="fjHuJian.icon">
                                    <vDataDetail :model="fjHuJian" :strong="fjHuJian.strong" :msList="fjHuJian.msList" :strongModel="fjHuJian.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ fjHuJian.strong ? '+' + fjHuJian.strong : '' }} 护肩：{{ fjHuJian.name }} {{ fjHuJian.level
                        }}
                        </div>
                        <div v-if="fjHuJian.icon">
                            <div class="del" @click="delDataModel('fjHuJian')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('fjHuJian')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                    <!-- 防具-手套 -->
                    <div class="fjShouTao CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('fjShouTao')">
                                <div v-if="fjShouTao.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + fjShouTao.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="fjShouTao.icon">
                                    <vDataDetail :model="fjShouTao" :strong="fjShouTao.strong" :msList="fjShouTao.msList" :strongModel="fjShouTao.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ fjShouTao.strong ? '+' + fjShouTao.strong : '' }} 手套：{{ fjShouTao.name }} {{ fjShouTao.level
                        }}
                        </div>
                        <div v-if="fjShouTao.icon">
                            <div class="del" @click="delDataModel('fjShouTao')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('fjShouTao')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                    <!-- 防具-鞋子 -->
                    <div class="fjXieZi CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('fjXieZi')">
                                <div v-if="fjXieZi.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + fjXieZi.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="fjXieZi.icon">
                                    <vDataDetail :model="fjXieZi" :strong="fjXieZi.strong" :msList="fjXieZi.msList" :strongModel="fjXieZi.strongModel">
                                    </vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">{{ fjXieZi.strong ? '+' + fjXieZi.strong : '' }} 鞋子：{{ fjXieZi.name }} {{ fjXieZi.level
                        }}
                        </div>
                        <div v-if="fjXieZi.icon">
                            <div class="del" @click="delDataModel('fjXieZi')"><i class="el-icon-error"></i></div>
                            <div class="add" @click="addMsStrong('fjXieZi')"><i class="el-icon-circle-plus"></i></div>
                        </div>
                    </div>
                </el-col>
                <el-col :span="12">
                    <!-- 饰品-头盔 -->
                    <div class="spTouKui CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spTouKui')">
                                <div v-if="spTouKui.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spTouKui.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spTouKui.icon">
                                    <vDataDetail :model="spTouKui"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">头盔：{{spTouKui.name}} {{ spTouKui.level }}</div>
                        <div v-if="spTouKui.icon">
                            <div class="del" @click="delDataModel('spTouKui')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-项链 -->
                    <div class="spXiangLian CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spXiangLian')">
                                <div v-if="spXiangLian.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spXiangLian.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spXiangLian.icon">
                                    <vDataDetail :model="spXiangLian"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">项链：{{spXiangLian.name}} {{ spXiangLian.level }}</div>
                        <div v-if="spXiangLian.icon">
                            <div class="del" @click="delDataModel('spXiangLian')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-耳环左 -->
                    <div class="spErHuanZ CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spErHuanZ')">
                                <div v-if="spErHuanZ.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spErHuanZ.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spErHuanZ.icon">
                                    <vDataDetail :model="spErHuanZ"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">耳环：{{spErHuanZ.name}} {{ spErHuanZ.level }}</div>
                        <div v-if="spErHuanZ.icon">
                            <div class="del" @click="delDataModel('spErHuanZ')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-耳环右 -->
                    <div class="spErHuanY CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spErHuanY')">
                                <div v-if="spErHuanY.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spErHuanY.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spErHuanY.icon">
                                    <vDataDetail :model="spErHuanY"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">耳环：{{spErHuanY.name}} {{ spErHuanY.level }}</div>
                        <div v-if="spErHuanY.icon">
                            <div class="del" @click="delDataModel('spErHuanY')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-戒指左 -->
                    <div class="spJieZhiZ CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spJieZhiZ')">
                                <div v-if="spJieZhiZ.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spJieZhiZ.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spJieZhiZ.icon">
                                    <vDataDetail :model="spJieZhiZ"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">戒指：{{spJieZhiZ.name}} {{ spJieZhiZ.level }}</div>
                        <div v-if="spJieZhiZ.icon">
                            <div class="del" @click="delDataModel('spJieZhiZ')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-戒指右 -->
                    <div class="spJieZhiY CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spJieZhiY')">
                                <div v-if="spJieZhiY.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spJieZhiY.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spJieZhiY.icon">
                                    <vDataDetail :model="spJieZhiY"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">戒指：{{spJieZhiY.name}} {{ spJieZhiY.level }}</div>
                        <div v-if="spJieZhiY.icon">
                            <div class="del" @click="delDataModel('spJieZhiY')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                    <!-- 饰品-腰带 -->
                    <div class="spYaoDai CalcBox">
                        <div class="iconBg">
                            <div class="icon" @click="changeZBData('spYaoDai')">
                                <div v-if="spYaoDai.icon"
                                    :style="{ background: 'url(/aion/images/game/icon/items/' + spYaoDai.icon + ')', width: '40px', height: '40px' }">
                                </div>
                                <div class="container" v-if="spYaoDai.icon">
                                    <vDataDetail :model="spYaoDai"></vDataDetail>
                                </div>
                            </div>
                        </div>
                        <div class="des">腰带：{{spYaoDai.name}} {{ spYaoDai.level }}</div>
                        <div v-if="spYaoDai.icon">
                            <div class="del" @click="delDataModel('spYaoDai')"><i class="el-icon-error"></i></div>
                        </div>
                    </div>
                </el-col>
            </el-row>
        </div>



        <el-dialog :visible.sync="dialogZBList" top="50px" width="1280px" title="选择装备" append-to-body>
            <vZBData @rowData="rowData" :isComponents="true"></vZBData>
        </el-dialog>

        <!-- 魔石设置 -->
        <el-dialog :visible.sync="dialogMSType" width="560px" title="魔石选择" append-to-body v-dialogDrag>
            <vMSSet :row="msRow" @MSData="MSData"></vMSSet>
        </el-dialog>

    </div>
</template>

<script>
import vZBData from "./data.vue"
import vDataDetail from './dataDetail.vue'
import vMSSet from './moshiSet.vue'
import {strongZB} from '@/components/game/aion/strongMoShi.js'
import {changeZB} from '@/components/game/aion/changeZB.js'
import {calcCount} from '@/components/game/aion/calcCount.js'
export default {
    components: { vZBData, vDataDetail, vMSSet },
    props: {
        occAttr: {}, //职业属性
        tzRow: {},//套装属性
    },
    data() {
        return {
            id: '',
            ZBType: '',
            isSSWQ: false, //是否双手武器
            row: {},
            row1: { "_id": "10fb47c36290603c03b82d7254a5ff9c", "icon": "icon_item_bow_u01.jpg", "name": "精锐执政官千夫长之长弓", "number": "101700644", "pingzhi": "唯一", "type": "弓", "level": "50", "bhurt": "220~299", "bspeed": "2.4", "bhit": "804", "bwlzm": "50", "bmfmz": "260", "ewlgj": "+30", "ewlzm": "+57", "egjsd": "+19%", "epvp+": "+10%", "ZBType": 1 },
            row2: { "_id": "10fb47c36290603c03b82d9b28f78582", "icon": "icon_item_sword_e01.jpg", "name": "塔哈巴塔之剑", "number": "100000768", "pingzhi": "英雄", "type": "单手剑", "level": "50", "bhurt": "161~197", "bspeed": "1.4", "bhit": "870", "bwlzm": "50", "bwqfy": "780", "bmfmz": "285", "egjsd": "+19%", "ewlmz": "+140", "ewlzm": "+78", "ewlgj": "+36", "ehp": "+317", "ZBType": 1 },
            dialogZBList: false,
            dialogDetail: false,

            dialogMSType: false,
            msRow: {},

            zbName: '',
            wuqiZ: {},
            wuqiY: {},
            wuqiHC: {},
            fjYiFu: {},
            fjXiaYi: {},
            fjHuJian: {},
            fjShouTao: {},
            fjXieZi: {},
            spTouKui: {},
            spXiangLian: {},
            spErHuanZ: {},
            spErHuanY: {},
            spJieZhiZ: {},
            spJieZhiY: {},
            spYaoDai: {},

            zbModelPre: {
                fjPre:{},
                spPre:{},
            },

            calcCount: {},
        }
    },
    mounted() {

    },
    methods: {
        changeZBData(name) {
            this.dialogZBList = true
            this.zbName = name
        },
        rowData(row) {
            this.dialogZBList = false
            this.row = row
            this.isDBWQFuntion(this.row.type)
            this.changeRowZB(this.zbName)
        },
        addMsStrong(name) {
            this.dialogMSType = true
            this.zbName = name
        },
        MSData(data) {
            this.dialogMSType = false
            this.MsStrongChange(data)
        },
        // 判断是否双手武器
        isDBWQFuntion(type) {
            if (type == '法杖' || type == '法典' || type == '宝珠' || type == '双手剑' || type == '巨剑' || type == '战戟' || type == '弓') {
                this.isSSWQ = true
            } else {
                this.isSSWQ = false
            }
        },
        // 按装备部位 赋值选择的数据和返回对应的显示 数值结果
        changeRowZB(zbName) {
            if(zbName=='wuqiZ'){
                this.wuqiZ = JSON.parse(JSON.stringify(this.row))
                let wqModel = changeZB(this.wuqiZ,zbName,this.isSSWQ,this.occAttr).wqModel
                this.zbModelPre.wuqiZPre = wqModel.wuqiZPre
            }
            if(zbName=='wuqiY'){
                this.wuqiY = JSON.parse(JSON.stringify(this.row))
                let wqModel = changeZB(this.wuqiY,zbName,this.isSSWQ,this.occAttr).wqModel
                this.zbModelPre.wuqiYPre = wqModel.wuqiYPre
            }
            if(zbName=='wuqiHC'){
                if(this.wuqiZ&&!(JSON.stringify(this.wuqiZ)=='{}')){
                    this.wuqiHC = JSON.parse(JSON.stringify(this.row))
                    let wqModel = changeZB(this.wuqiHC,zbName,this.isSSWQ,this.occAttr).wqModel
                    this.zbModelPre.wuqiHCPre = wqModel.wuqiHCPre
                }else{
                    this.$message.error("合成武器请先选择双手武器!")
                }
            }
            if(zbName=='fjYiFu'){
                this.fjYiFu = JSON.parse(JSON.stringify(this.row))
                let fjModel = changeZB(this.fjYiFu,zbName).fjModel
                this.zbModelPre.fjPre.fjYiFu = fjModel.fjYiFu
            }
            if(zbName=='fjXiaYi'){
                this.fjXiaYi = JSON.parse(JSON.stringify(this.row))
                let fjModel = changeZB(this.fjXiaYi,zbName).fjModel
                this.zbModelPre.fjPre.fjXiaYi = fjModel.fjXiaYi
            }
            if(zbName=='fjHuJian'){
                this.fjHuJian = JSON.parse(JSON.stringify(this.row))
                let fjModel = changeZB(this.fjHuJian,zbName).fjModel
                this.zbModelPre.fjPre.fjHuJian = fjModel.fjHuJian
            }
            if(zbName=='fjShouTao'){
                this.fjShouTao = JSON.parse(JSON.stringify(this.row))
                let fjModel = changeZB(this.fjShouTao,zbName).fjModel
                this.zbModelPre.fjPre.fjShouTao = fjModel.fjShouTao
            }
            if(zbName=='fjXieZi'){
                this.fjXieZi = JSON.parse(JSON.stringify(this.row))
                let fjModel = changeZB(this.fjXieZi,zbName).fjModel
                this.zbModelPre.fjPre.fjXieZi = fjModel.fjXieZi
            }
            if(zbName=='spTouKui'){
                this.spTouKui = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spTouKui,zbName).spModel
                this.zbModelPre.spPre.spTouKui = spModel.spTouKui
            }
            if(zbName=='spXiangLian'){
                this.spXiangLian = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spXiangLian,zbName).spModel
                this.zbModelPre.spPre.spXiangLian = spModel.spXiangLian
            }
            if(zbName=='spErHuanZ'){
                this.spErHuanZ = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spErHuanZ,zbName).spModel
                this.zbModelPre.spPre.spErHuanZ = spModel.spErHuanZ
            }
            if(zbName=='spErHuanY'){
                this.spErHuanY = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spErHuanY,zbName).spModel
                this.zbModelPre.spPre.spErHuanY = spModel.spErHuanY
            }
            if(zbName=='spJieZhiZ'){
                this.spJieZhiZ = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spJieZhiZ,zbName).spModel
                this.zbModelPre.spPre.spJieZhiZ = spModel.spJieZhiZ
            }
            if(zbName=='spJieZhiY'){
                this.spJieZhiY = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spJieZhiY,zbName).spModel
                this.zbModelPre.spPre.spJieZhiY = spModel.spJieZhiY
            }
            if(zbName=='spYaoDai'){
                this.spYaoDai = JSON.parse(JSON.stringify(this.row))
                let spModel = changeZB(this.spYaoDai,zbName).spModel
                this.zbModelPre.spPre.spYaoDai = spModel.spYaoDai
            }
            // console.log(this.zbModelPre)
            this.calcCountAttr()
        },
        // 按 部位 清空对应的数据
        delDataModel(name) {
            this.zbName = name
            if (name == 'wuqiZ') {
                this.wuqiZ = {}
                this.zbModelPre.wuqiZPre = {}
                // 左手清空，武器全部清空
                this.wuqiHC = {}
                this.zbModelPre.wuqiHCPre = {}
                this.wuqiY = {}
                this.zbModelPre.wuqiYPre = {}
            } else if (name == 'wuqiY') {
                this.wuqiY = {}
                this.zbModelPre.wuqiYPre = {}
            } else if (name == 'wuqiHC') {
                this.wuqiHC = {}
                this.zbModelPre.wuqiHCPre = {}
            } else if (name == 'fjYiFu') {
                this.fjYiFu = {}
                this.zbModelPre.fjPre.fjYiFu = {}
            } else if (name == 'fjXiaYi') {
                this.fjXiaYi = {}
                this.zbModelPre.fjPre.fjXiaYi = {}
            } else if (name == 'fjHuJian') {
                this.fjHuJian = {}
                this.zbModelPre.fjPre.fjHuJian = {}
            } else if (name == 'fjShouTao') {
                this.fjShouTao = {}
                this.zbModelPre.fjPre.fjShouTao = {}
            } else if (name == 'fjXieZi') {
                this.fjXieZi = {}
                this.zbModelPre.fjPre.fjXieZi = {}
            } else if (name == 'spTouKui') {
                this.spTouKui = {}
                this.zbModelPre.spPre.spTouKui = {}
            } else if (name == 'spXiangLian') {
                this.spXiangLian = {}
                this.zbModelPre.spPre.spXiangLian = {}
            } else if (name == 'spErHuanZ') {
                this.spErHuanZ = {}
                this.zbModelPre.spPre.spErHuanZ = {}
            } else if (name == 'spErHuanY') {
                this.spErHuanY = {}
                this.zbModelPre.spPre.spErHuanY = {}
            } else if (name == 'spJieZhiZ') {
                this.spErHuanY = {}
                this.zbModelPre.spPre.spErHuanY = {}
            } else if (name == 'spJieZhiY') {
                this.spJieZhiY = {}
                this.zbModelPre.spPre.spJieZhiY = {}
            } else if (name == 'spYaoDai') {
                this.spYaoDai = {}
                this.zbModelPre.spPre.spYaoDai = {}
            }
            // console.log(this.zbModelPre)
            this.calcCountAttr()
        },
        // 按类型添加对应 魔石和强化等级
        MsStrongChange(data) {
            // console.log(data)
            if (this.zbName == 'wuqiZ') {
                let strongMsModel = strongZB(this.wuqiZ,data)
                this.wuqiZ.strong = JSON.parse(JSON.stringify(data.strong))
                this.wuqiZ.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.wuqiZ.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.wuqiZPre.strongMsModel = strongMsModel
            } else if (this.zbName == 'wuqiHC') {
                let strongMsModel = strongZB(this.wuqiHC,data)
                this.wuqiHC.strong = data.strong
                this.wuqiHC.msList = data.msList
                this.zbModelPre.wuqiHCPre.strongMsModel = strongMsModel
            } else if (this.zbName == 'wuqiY') {
                let strongMsModel = strongZB(this.wuqiY,data)
                this.wuqiY.strong = JSON.parse(JSON.stringify(data.strong))
                this.wuqiY.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.wuqiY.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.wuqiYPre.strongMsModel = strongMsModel
            } else if (this.zbName == 'fjYiFu') {
                let strongMsModel = strongZB(this.fjYiFu,data,this.zbName)
                this.fjYiFu.strong = JSON.parse(JSON.stringify(data.strong))
                this.fjYiFu.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.fjYiFu.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.fjPre.fjYiFu.strongMsModel = strongMsModel
            } else if (this.zbName == 'fjXiaYi') {
                let strongMsModel = strongZB(this.fjXiaYi,data,this.zbName)
                this.fjXiaYi.strong = JSON.parse(JSON.stringify(data.strong))
                this.fjXiaYi.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.fjXiaYi.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.fjPre.fjXiaYi.strongMsModel = strongMsModel
            } else if (this.zbName == 'fjHuJian') {
                let strongMsModel = strongZB(this.fjHuJian,data,this.zbName)
                this.fjHuJian.strong = JSON.parse(JSON.stringify(data.strong))
                this.fjHuJian.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.fjHuJian.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.fjPre.fjHuJian.strongMsModel = strongMsModel
            } else if (this.zbName == 'fjShouTao') {
                let strongMsModel = strongZB(this.fjShouTao,data,this.zbName)
                this.fjShouTao.strong = JSON.parse(JSON.stringify(data.strong))
                this.fjShouTao.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.fjShouTao.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.fjPre.fjShouTao.strongMsModel = strongMsModel
            } else if (this.zbName == 'fjXieZi') {
                let strongMsModel = strongZB(this.fjXieZi,data,this.zbName)
                this.fjXieZi.strong = JSON.parse(JSON.stringify(data.strong))
                this.fjXieZi.strongModel = JSON.parse(JSON.stringify(strongMsModel.strongModel))
                this.fjXieZi.msList = JSON.parse(JSON.stringify(data.msList))
                this.zbModelPre.fjPre.fjXieZi.strongMsModel = strongMsModel
            }
            this.calcCountAttr()
        },
        // 汇总计算对应的值
        calcCountAttr() {
            this.zbModelPre.tzInfo = this.tzRow
            let calcAttrPre = calcCount(this.zbModelPre,this.isSSWQ,this.occAttr)
            this.$emit('calcCount', calcAttrPre)
        },
        
    },
}
</script>

<style scoped>
</style>